<template>
  <el-menu 
    unique-opened
    router
    class="cus-el-menu cus-scrollbar"
    :default-active="$route.meta.activeMenu">
    <template v-for="router in routers">
      <menu-item :router="router" :key="router.path"></menu-item>
    </template>
  </el-menu>
</template>

<script>
  
  import menuItem from './menuItem.vue'
  
  export default {
    components: {
      menuItem
    },
    data() {
      return {
        routers: []
      }
    },
    created() {
      this.routers = JSON.parse(sessionStorage.getItem('user')).routers;
    }
  }
  
</script>

<style lang="scss" scoped>
  
  .cus-el-menu {
    width: 260px;
    height: 100%;
    overflow-y: auto;
    border: none;
  }
</style>
